﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Wpf.Ui.Controls;

namespace ClientAppraise.Controls
{
    public class ZxAliFontIcon : FontIcon
    {
        public ZxAliFontIcon()
        {
            FontFamily = new System.Windows.Media.FontFamily(new Uri("pack://application:,,,/"), "./Assets/Fonts/#iconfont");
        }

        public ZxAliFontIcon(ZxAliRegular symbol, double fontSize = 14) : this()
        {
            Glyph = GetString(symbol);
            FontSize = fontSize;
        }

        private static string GetString(ZxAliRegular icon)
        {
            return Encoding.Unicode.GetString(BitConverter.GetBytes((int)icon)).TrimEnd('\0');
        }
    }

}
